<aside id="sidebar" class="column">
<?php
    foreach ($menu as $menu_parent) 
    {
        if ($menu_parent['parent_menu_id'] == 0) //jika menu parent = 0 (menu utama)
        {
            echo "<h3>".$menu_parent['menu_title']."</h3>";
            echo "<ul class=\"toggle\">";
            foreach ($menu as $menu_child) //perulangan untuk mengetahui submenu
            {
                if ($menu_child['parent_menu_id'] == $menu_parent['menu_id']) //jika id submenu = id menu utama
                {
                    $link = site_url($menu_child['mdl_link']);
                    echo "<li class=\"icn_new_article\">";
                    echo "<a href=\"javascript:void(0)\" onclick=\"do_load('$link')\">".$menu_child['menu_title']."</a></li>";
                }
            }
            echo "</ul>";
        }
    }
//print_r($menu);
?>
<footer>
    <hr />
    <p><strong>Copyright &copy; 2011 Website Admin</strong></p>
    <p>Theme by <a href="http://www.medialoot.com">MediaLoot</a></p>
</footer>
</aside>
<!-- end of sidebar -->
